package asimes.javaFX;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;

public class ShowImage extends Application {
    public static void main(String[] args) {
        Application.launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        BorderPane pane = new BorderPane();
        Image image = new Image("file:C:\\Users\\asime\\Downloads\\W65-《植物大战僵尸》\\《植物大战僵尸》\\Plants\\SnowPea\\SnowPea.gif");
        ImageView imageView = new ImageView();
        imageView.setImage(image);
        pane.setCenter(imageView);
        double width = image.getWidth();
        double height = image.getHeight();
        Scene scene = new Scene(pane, width, height);
        primaryStage.setScene(scene);
        primaryStage.setTitle("ImageView");
        primaryStage.show();

    }
}
